Sparkly code princess.
47 stories
·
1 follower

Biff Tannen

5 Comments and 7 Shares
I can't help myself; now I want to read a bunch of thinkpieces from newspapers in Biff's 1985 arguing over whether the growth of the region into a corporate dystopia was inevitable.
Read the whole story
simon_w
394 days ago
reply
I would read this book.
Wellington, New Zealand
Share this story
Delete
4 public comments
satadru
392 days ago
reply
I don't know what to believe any more.
New York, NY
Covarr
394 days ago
reply
They say that money corrupts you. But I can't really tell.
Moses Lake, WA
alt_text_at_your_service
394 days ago
reply
I can't help myself; now I want to read a bunch of thinkpieces from newspapers in Biff's 1985 arguing over whether the growth of the region into a corporate dystopia was inevitable.
alt_text_bot
394 days ago
reply
I can't help myself; now I want to read a bunch of thinkpieces from newspapers in Biff's 1985 arguing over whether the growth of the region into a corporate dystopia was inevitable.

Experience is a candle

3 Shares

Read the whole story
simon_w
477 days ago
reply
Wellington, New Zealand
Share this story
Delete

Cramming

1 Comment

Read the whole story
simon_w
647 days ago
reply
This is the sort of cramming I can get behind.
Wellington, New Zealand
Share this story
Delete

HHVM 3.26 - Introducing HackC

1 Comment

HHVM 3.26 is released! Highlights include a new frontend, relicensing of the typechecker and related tools and libraries to MIT, and support for Ubuntu 18.04. Packages have been published in the usual places.

HackC: The Hack Compiler

The Hack & HHVM team is excited to announce that HackC — the new front-end for HHVM — is now on by default in this release, after about a year of work by many. This includes a full-fidelity parser (FFP) and bytecode emitter for the Hack and PHP languages. The FFP already powered several tools, such as Hack’s IDE integration via the Language Server Protocol, hackfmt, and hhast; in addition to the runtime, we expect the typechecker (hh_client and hh_server) to use the FFP in the future, leading to a single unified parser for typechecking, execution, IDE services, and other tools.

HackC passes all of HHVM’s tests - including the PHP specification tests - and produces semantically equivalent bytecode. That said, if you encounter problems:

  • you can temporarily revert to the legacy frontend with the hhvm.hack_compiler_default=false INI setting
  • please file a GitHub issue including minimal example code to reproduce the problem; this is extremely important as we plan to remove the legacy frontend in 3.27

You can verify which frontend is being used by inspecting the __COMPILER_FRONTEND__ magic constant.

Hack Relicensing

As previously announced, Hack is now available under the MIT license. 3.26 is the first stable release to include Hack under these terms.

Other Highlights

  • added the nonnull type, allowing more thorough and consistent typing - e.g. function nullthrows<T as nonnull>(?T $in): T
  • added the dynamic type to allow safer dynamic code, as an alternative to untyped or mixed
  • improved handling of STDOUT with a Debug Adapter Protocol debugger attached
  • hh_parse now can produce dot (Graphviz) representations of the AST - e.g. hh_parse --full-fidelity-dot test.hh | dot -Tpng ast.png; open ast.png
  • legacy IDE support (hh_client ide) has been removed; the VSCode Language Server Protocol (hh_client lsp) should be used instead
  • many improvements to LSP-based IDE features, such as autocomplete and function hover information
  • several Hack changes that were opt-in in HHVM 3.25 are no longer optional. PHP code is unaffected. These changes include:
    • namespace fallback is no longer supported for functions or constants (e.g. ‘FOO’ is always equivalent to ‘namespace\FOO’)
    • array unpacking will raise errors if there are potentially unmet requirements for the number of unpacked values
    • destructors are no longer support. Use using blocks and Disposables instead.
    • arrays can no longer include references. This also means it’s not possible to make references to array elements, or pass by array elements by reference.
    • untyped lambdas can not be passed as non-function types (e.g. to functions that accept mixed)
  • opt-in: ban whitespace and comments in the ‘elvis’ (?:) operator - e.g. $foo = bar() ? /* hello, world */ : baz();. To ban this syntax, set disallow_elvis_space=true in your .hhconfig. We expect this to be required in 3.27.

The dynamic Type

dynamic is a new type we’ve added to Hack’s type system. The dynamic type is a special type in Hack used to help capture dynamism in our codebase in typed code, in a more manageable manner than mixed. With the dynamic type, the presence of dynamism in a function is local to the function, and dynamic behaviors cannot leak into code that doesn’t know about it.

For example, this untyped code will not raise type errors, as the typechecker assumes any use of untyped variables ($x) is valid:

1
2
3
4
5
6
7
8
function takesInt(int $x) : int {
  //...
}

function f($x) {
  $id = $x->getInt();
  $y = takesInt($id);
}

With dynamic, the local usage is allowed, but dynamism must be removed at the function boundaries:

1
2
3
4
5
6
7
8
9
10
11
function takesInt(int $x) : int {
  //...
}

function f(dynamic $x) : void {
  // Calling a method on a dynamic type is allowed,
  //  and will result in another dynamic 
  $id = $x->getInt(); 
   // error! id is type dynamic, not compatible with int
  $y = takesInt($id); 
}

Finally, with mixed, the type must be refined before use:

1
2
3
4
5
6
7
8
function takesInt(int $x) : int {
  //...
}

function f(mixed $x) : void {
  $id = $x->getInt(); // error! $x is mixed, cannot call getInt()
  $y = takesInt($id);
}

Details

  • A value of type dynamic is permissive of most local operations: like untyped expressions, you can treat it like an integer and add it, or a string and concatenate it, or call any methods on it.
  • When using a dynamic type in an operation, the typechecker will infer the best possible type with the information it has. For example, using a dynamic in an arithmetic operation like “+” or “-” will result in a num, using a dynamic in a string operation will result in a string, but calling a method on a dynamic will result in another dynamic:
1
2
3
4
5
function f(dynamic $x) : void {
  $y = $x + 5; // $y is a num
  $y = $x . "hello!"; // $y is a string 
  $y = $x->anyMethod(); // $y is dynamic
}
  • In the type hierarchy, dynamic is a supertype of all types(including mixed, though this might change). If a function accepts or returns a dynamic type any value can be used without performing a cast. We may limit or change this behavior in the future based on feedback and usage.
  • dynamic is permissive locally, so you don’t have to null check it. That said, this means there are no guarantees by the typechecker that your type is actually nonnull. We also may change this behavior in the future.
  • Unlike untyped expressions, dynamic is not a subtype of any regular type. That is, you cannot pass it to a function that expects a nondynamic type, or return it from a function that returns a nondynamic type (besides mixed) without casting.
  • Certain dynamic behaviors, (like dynamic method calls) are allowed on dynamic types, even in strict mode. These operations result in another dynamic type.
Read the whole story
simon_w
660 days ago
reply
Some exciting new developments for Hacklang :)
Wellington, New Zealand
Share this story
Delete

Joke Accounts and the BOFH are Garbage

1 Share

You might be familiar with tech joke accounts on Twitter, stuff like PHP CEO and I Am Devloper. These are accounts meant to poke fun at specific stereotypes of people in the tech community, in these cases an ignorant CEO and an incompetent developer, by posting concepts that echo strongly within the experiences of people within tech.

And I came across a tweet on my timeline today, from the I Am Devloper account: https://twitter.com/iamdevloper/status/869931002076028930 and my first (and continued) response has been 😡, because this sort of thing is not okay.

I speak a lot about contempt culture because it’s such an important construct, talking about how we build zones of exclusion within our culture, but I’ve not talked as much about propagation and normalisation of contempt culture.

This is one of the ways it propagates and normalises.

So, a tweet like this from an account like this is about being funny. But how tweet works is (and how the BOFH works) is that it positions this attitude and belief as what we’re all already thinking, the thing that we’re just not admitting to. It’s funny because it’s true!

And we think it’s true because our broader culture has primed us to a belief that frontend as a discipline isn’t real programming, which is easily visible in the number of non-Javascript communities spending considerable effort trashing Javascript patterns, code, and technologies, but backend programming is real programming”. We see it intensely in oh, there’s 3 new frameworks per second in Javascript”, as though trying to find and explore best practises in a field is something to be derided and contemptuous of.

Of course, frontend can’t win there, because if they weren’t looking for best practises they’d end up with the PHP narrative of look how bad they are, lol” that has infested the industry for the last 20 years.

The end result is that making fun of PHP, or Javascript, or whatever today’s hated technology is normalises that elitism is how we bond, how we show that oh yeah we’ll get along with each other just fine”.

Infection

The worst part of this is when it comes to newcomers. People enter our industry and communities and see us acting like this. They don’t necessarily see that we’ve laughing at this as a haha-only-serious” sort of irony”1 that underlies our jokes”.

As a result, they internalise this as what they should believe, what ought to be true. This is reinforced by how we already use it as a bonding mechanism. At least we’re not PHP developers!” we laugh. At least we don’t use Java!”, or JavaScript.

At least we aren’t like those lesser people who aren’t even real programmers. We joke like this and newcomers treat it as serious, treat it as intentional and real opinions and pass them onwards.

We carry who we are through every space we enter and these ideas propagate as we get new jobs and join new communities, as we continue to heap scorn upon entire disciplines (like design, or user experience).

I carried the ideas of the BOFH for years, thought that thinly veiled contempt was how we were supposed to think and behave. I carried this forward as the wish fulfilment of being taught to think I was better than users, smarter and more capable. The world around me reinforced this (Wow, you know computers? You must be so smart!), and other people in tech referencing it. Wishing for the LART. Wishing they could tell users what they really thought.

Wishing that it was real.

It wasn’t treated as a joke, it was treated as real, as the real emotions and thoughts and attitude that I should be carrying.

And jokes like I Am Devloper’s do the same. It teaches that we should hold frontend in contempt, that we should carry that self into new spaces, that we should treat people with those skills as not real programmers, not competent like we are, not capable or intelligent or able to build good software. That they, unlike us, do not belong.

And this made me realise that that is all these accounts do by pushing us to empathise with our own exclusivity and superiority, that instead of a culture where we are aiming for actual conversations and collaboration with skillsets that are not our own. That all these accounts do is teach newcomers that they should act like this, should act with hostility, with contempt, with malice towards outsiders.

And that, is, garbage.


  1. Hint: Ironic contempt is still contempt

Read the whole story
simon_w
665 days ago
reply
Wellington, New Zealand
Share this story
Delete

Questioned to Death

1 Share

Read the whole story
simon_w
690 days ago
reply
Wellington, New Zealand
Share this story
Delete
Next Page of Stories